package com.ciklum.vlgu;

import static org.junit.Assert.assertTrue;

import org.testng.annotations.Test;

import com.ciklum.vlgu.model.User;
import com.ciklum.vlgu.pages.TestBase;

public class AddNewUser extends TestBase {
	
	@Test
	public void addNewUserOK() {
		String username ="user" + System.currentTimeMillis();
		
		User user = new User()
			.setLogin(username)
			.setPassword("password")
			.setEmail(username + "@test.com");
		
		app.getUserHelper().loginAs(ADMIN);
		app.getUserHelper().createUser(user);
		app.getUserHelper().logout();
		app.getUserHelper().loginAs(user);
		assertTrue(app.getUserHelper().isLoggedInAs(user));
	}

}
